package creational.singleton.lazyman;

import creational.singleton.Singleton;

/**
 * 懒汉式单例1,在第一次调用时才会初始化.线程不安全!
 *
 * @author binbin
 * @since 2022/10/4 14:23
 */
public class LazyManSingleton1 implements Singleton {

    private static LazyManSingleton1 instance;

    private LazyManSingleton1() {
    }

    public static LazyManSingleton1 getInstance() {
        if (instance == null) {
            instance = new LazyManSingleton1();
        }
        return instance;
    }
}
